* Replication syntax for "Do austerity cuts spare police budgets?"
* Brenden Beck
* 6.9.2024

cd ""

use "Austerity.dta"

log using "Austerity Results.log", replace

************** Table 1. Expenditure Measure Medians **************
* Generate sample
drop sampaustd
gen sampaustd = 1 if ipop90>50000 & lowmi==1
* Expenditure Measure Medians
tabstat rpolexplcpc rsocexplcpc rtotexplcpc ratpolsoc rpolexplcpt rsocexplcpt polexpfiscpc soceduexpfiscpc ratpolsocedufisc rpolexplcpn rsocexplcpn if sampaustd==1 & year==1990 [aw=ipop90], stat(med) f(%9.2f)
tabstat polexpfiscpc soceduexpfiscpc ratpolsocedufisc if sampaustd==1 & year==2016 [aw=ipop90], stat(med) f(%9.2f)
tabstat rpolexplcpc rsocexplcpc rtotexplcpc ratpolsoc rpolexplcpt rsocexplcpt rpolexplcpn rsocexplcpn if sampaustd==1 & year==2019 [aw=ipop90], stat(med) f(%9.2f)
************** End Table 1. Expenditure Measure Medians **************

************** Table 2. Descriptive Means, Medians, and SDs **************
* Linear 
sum rpolexplcpc rsocexplcpc rhealexplcpc rhospexplcpc rlibexplcpc rpubassexplcpc rparksexplcpc rhouscommexplcpc ratpolsoc rtotrevpc ndrtotrevpccum pdrtotrevpccum iviocrimertucr maypartnum iunemprate ippov ipnhblk iplat ipmen15to34 ipvhu ipop if sampaustr==1 [aw=ipop90]
* Log
sum lrpolexplcpc lrsocexplcpc lrhealexplcpc lrhospexplcpc lrlibexplcpc lrpubassexplcpc lrparksexplcpc lrhouscommexplcpc lratpolsoc lrtotrevpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu lipop if sampaustr==1 [aw=ipop90]
**************** End Descriptive Means and SDs *******************

*************** Figure 1. Spending trends ***************
* Fig 1. Spending per cap
table year if sampaustd==1 [aw=ipop90], stat(med rpolexplcpc) stat(med rsocexplcpc) nformat(%15.0f)
collect export "fig1a.xlsx", replace
************** End Figure 1. Spending trends *************

************** Plotting residuals **************
reg lrpolexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], cluster(fipsnum)
rvfplot
************** End, plotting residuals ***********

************** Table 2. Main models of Police and Social Service spending ************
xtset fipsnum year
* Police, per cap
xtreg lrpolexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)
* Generate sample
drop sampaustr
gen sampaustr = e(sample)
save, replace
* Social, per cap
xtreg lrsocexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)
* Ratio
xtreg lratpolsoc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 [aw=ipop90], fe cluster(fipsnum)
* Medians for calculations of the magnitude of the relationship
sum ndrtotrevpc if sampaustr==1 & ndrtotrevpc>0 [aw=ipop90], d
sum rtotrevpc rpolexplcpc rsocexplcpc if sampaustr==1 [aw=ipop90], d
**************** End Table 2 ****************

**************** Fig 3. Social service functions disaggregated ****************
xtset fipsnum year
* Per capita outcomes
eststo clear
eststo: xtreg lrpolexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 [aw=ipop90], fe cluster(fipsnum)
eststo: xtreg lrhealexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 [aw=ipop90], fe cluster(fipsnum)
eststo: xtreg lrhospexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 [aw=ipop90], fe cluster(fipsnum)
eststo: xtreg lrlibexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 [aw=ipop90], fe cluster(fipsnum)
eststo: xtreg lrpubassexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 [aw=ipop90], fe cluster(fipsnum)
eststo: xtreg lrparksexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 [aw=ipop90], fe cluster(fipsnum)
eststo: xtreg lrhouscommexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 [aw=ipop90], fe cluster(fipsnum)
esttab, cells(b(star fmt(3)) se(par fmt(3)))
eststo clear

* Ratio outcomes
eststo clear
eststo: xtreg lratpolheal ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 [aw=ipop90], fe cluster(fipsnum)
eststo: xtreg lratpolhosp ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 [aw=ipop90], fe cluster(fipsnum)
eststo: xtreg lratpollib ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 [aw=ipop90], fe cluster(fipsnum)
eststo: xtreg lratpolpubass ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 [aw=ipop90], fe cluster(fipsnum)
eststo: xtreg lratpolparks ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 [aw=ipop90], fe cluster(fipsnum)
eststo: xtreg lratpolhouscomm ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 [aw=ipop90], fe cluster(fipsnum)
esttab, cells(b(star fmt(3)) se(par fmt(3)))
eststo clear
************* End Fig. 3 Social service functions disaggregated ************

******************************* Fig 4. Unionization and region  *******************************
xtset fipsnum year
*** (0) Baseline models
xtreg lrpolexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 [aw=ipop90], fe cluster(fipsnum)
xtreg lrsocexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 [aw=ipop90], fe cluster(fipsnum)

*** (1) Unionized
xtreg lrpolexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 & uniondum==1 [aw=ipop90], fe cluster(fipsnum)
xtreg lrsocexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 & uniondum==1 [aw=ipop90], fe cluster(fipsnum)
* Ratio
xtreg lratpolsoc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 & uniondum==1 [aw=ipop90], fe cluster(fipsnum)

*** (2) Not unionized
xtreg lrpolexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 & uniondum==0 [aw=ipop90], fe cluster(fipsnum)
xtreg lrsocexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 & uniondum==0 [aw=ipop90], fe cluster(fipsnum)
* Ratio (not statistically significant)
xtreg lratpolsoc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 & uniondum==0 [aw=ipop90], fe cluster(fipsnum)

*** (3) South
xtreg lrpolexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 & censusregion=="South" [aw=ipop90], fe cluster(fipsnum)
xtreg lrsocexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 & censusregion=="South" [aw=ipop90], fe cluster(fipsnum)
* Ratio
xtreg lratpolsoc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 & censusregion=="South" [aw=ipop90], fe cluster(fipsnum)

*** (4) Oustide the South
xtreg lrpolexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 & censusregion!="South" [aw=ipop90], fe cluster(fipsnum)
xtreg lrsocexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 & censusregion!="South" [aw=ipop90], fe cluster(fipsnum)
* Ratio
xtreg lratpolsoc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 & censusregion!="South" [aw=ipop90], fe cluster(fipsnum)
***************************** End, Fig 4. unionization and region  *****************************

******************************* Fig 5. Sensitivity Checks  *******************************
xtset fipsnum year
*** (0) Baseline models
xtreg lrpolexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 [aw=ipop90], fe cluster(fipsnum)
xtreg lrsocexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 [aw=ipop90], fe cluster(fipsnum)
* Ratio to test joint significance 
xtreg lratpolsoc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if sampaustr==1 [aw=ipop90], fe cluster(fipsnum)

*** (1) Spending as percent of total
xtreg lrpolexplcpt ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate ippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)
xtreg lrsocexplcpt ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate ippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)
* Ratio
xtreg lratpolsocpt ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate ippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)

*** (2) Year fixed effects
xtreg lrpolexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum yr1990-yr2019 if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)
xtreg lrsocexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum yr1990-yr2019 if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)
* Ratio
xtreg lratpolsoc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum yr1990-yr2019 if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)

*** (3) Lag independent vars one year
xtreg f.lrpolexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)
xtreg f.lrsocexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)
* Ratio
xtreg f.lratpolsoc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)

*** (4) Lag dependent variable one year
xtreg lrpolexplcpc l.lrpolexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)
xtreg lrsocexplcpc l.lrsocexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)
* Ratio 
xtreg lratpolsoc l.lratpolsoc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)

*** (5) Cities larger than 100,000
xtreg lrpolexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 & ipop90>100000 [aw=ipop90], fe cluster(fipsnum)
xtreg lrsocexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 & ipop90>100000 [aw=ipop90], fe cluster(fipsnum)
* Ratio
xtreg lratpolsoc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 & ipop90>100000 [aw=ipop90], fe cluster(fipsnum)

*** (6) Cities smaller than 100,000
xtreg lrpolexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 & ipop90<100000 [aw=ipop90], fe cluster(fipsnum)
xtreg lrsocexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 & ipop90<100000 [aw=ipop90], fe cluster(fipsnum)
* Ratio (not statistically significant)
xtreg lratpolsoc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 & ipop90<100000 [aw=ipop90], fe cluster(fipsnum)

*** (7) Only places with >29 years of non-missing data 
xtreg lrpolexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & nmratpolsoc9019>=29 [aw=ipop90], fe cluster(fipsnum)
xtreg lrsocexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & nmratpolsoc9019>=29 [aw=ipop90], fe cluster(fipsnum)
* Ratio
xtreg lratpolsoc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & nmratpolsoc9019>=29 [aw=ipop90], fe cluster(fipsnum)

*** (8) Omit population weights
xtreg lrpolexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1, fe cluster(fipsnum)
xtreg lrsocexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1, fe cluster(fipsnum)
* Ratio
xtreg lratpolsoc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1, fe cluster(fipsnum)

*** (9) All local government spending
xtreg lpolexpfiscpc ndlrtotrevfiscpccum pdlrtotrevfiscpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)
xtreg lsoceduexpfiscpc ndlrtotrevfiscpccum pdlrtotrevfiscpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)
* Ratio
xtreg lratpolsocedufisc ndlrtotrevfiscpccum pdlrtotrevfiscpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)

*** (10) Property crime as additional control
xtreg lrpolexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr lipropcrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)
xtreg lrsocexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr lipropcrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)
* Ratio
xtreg lratpolsoc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr lipropcrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)

*** (11) Include fines & fees as a standalone predictor
xtreg lrpolexplcpc ndlrtotrevlffpccum pdlrtotrevlffpccum lirffpc liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)
xtreg lrsocexplcpc ndlrtotrevlffpccum pdlrtotrevlffpccum lirffpc liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)
* Ratio
xtreg lratpolsoc ndlrtotrevlffpccum pdlrtotrevlffpccum lirffpc liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)

** (12) Own-source revenue only
xtreg lrpolexplcpc cndlrtotal_rev_own_sourcespc cpdlrtotal_rev_own_sourcespc  liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)
xtreg lrsocexplcpc cndlrtotal_rev_own_sourcespc cpdlrtotal_rev_own_sourcespc  liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)
* Ratio 
xtreg lratpolsoc cndlrtotal_rev_own_sourcespc cpdlrtotal_rev_own_sourcespc liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(fipsnum)

** (13) Cluster SEs at the state level
xtreg lrpolexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(nSTATEFP)
xtreg lrsocexplcpc ndlrtotrevpccum pdlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(nSTATEFP)
* Ratio
xtreg lratpolsoc ndlrtotrevlffpccum pdlrtotrevlffpccum lirffpc liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1 [aw=ipop90], fe cluster(nSTATEFP)
******************************* End Fig 5. Sensitivity Checks *******************************

*************************** York and Light test for asymmetry ***************************
* Police
xtreg lrpolexplcpc dlrtotrevpccum rndlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1  [aw=ipop90], fe cluster(fipsnum)
* Social
xtreg lrsocexplcpc dlrtotrevpccum rndlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1  [aw=ipop90], fe cluster(fipsnum)
* Ratio
xtreg lratpolsoc dlrtotrevpccum rndlrtotrevpccum liviocrimertucr liunemprate lippov lipnhblk liplat lipmen15to34 lipvhu i.maypartnum if ipop90>50000 & lowmi==1  [aw=ipop90], fe cluster(fipsnum)
*************************** End York and Light test for asymmetry ***************************

******************************* Appendix *******************************
*** Revenue as a categorical variable 
* Police
xtreg rpolexplcpc ib4.cat7drtotrevpc iviocrimertucr iunemprate ippov ipnhblk iplat ipmen15to34 ipvhu i.maypartnum if ipop90>50000 & lowmi==1  [aw=ipop90], fe cluster(fipsnum)
* Social
xtreg rsocexplcpc ib4.cat7drtotrevpc iviocrimertucr iunemprate ippov ipnhblk iplat ipmen15to34 ipvhu i.maypartnum if ipop90>50000 & lowmi==1  [aw=ipop90], fe cluster(fipsnum)
******************************* End Appendix *******************************

******************************* Support for first paragraph analysis *******************************
use "Pierson/MunicipalData.dta"
sum rhouexplcpc if pop80>50000 & year==1980 [aw=pop80], d
gen rsoclesshoupc = rsocexppc - rhouexplcpc
sum rsoclesshoupc if pop80>50000 & year==1980 [aw=pop80], d
******************************* End support for first paragraph analysis *******************************

log close
